<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/public/BaseCms.php";

/**
 * 单页面
 * Class Page
 */
class Page extends BaseCms
{
    public $tb_name = "pages";
    public $menu_data, $content;

    function __construct()
    {
        parent::__construct($this->tb_name);
    }


    /**
     * 初始化数据
     * @param $data_id 数据编号
     */
    function loadById($data_id)
    {
        $condition = ["id_pages" => $data_id];
        $this->content = $this->findOne($condition);
    }

    /**
     * 初始化数据
     * @param $data_id 数据编号
     */
    function loadByCategoryId($data_id)
    {
        $condition = ["id_data_category" => $data_id];
        $orderBy=["top_show"=>"asc","index_show"=>"asc","created_date"=>"desc"];
        $this->content = $this->findOne($condition,$orderBy);
    }

}